import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2025-03-10
 * Time: 20:02
 */
public class test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        float a = scanner.nextFloat();
        char b = scanner.next().charAt(0);
        int c=(int)Math.ceil(a)-1;
        if(a<1){
            //不超重
            System.out.println(20);
        }else if (b=='n'){
            //不加急and超重


            System.out.println(20+c);
        }else {
            //加急and超重
            //将a向上取整

            System.out.println(20+c+5);
        }
    }
}
